#include <carbon/core/optional.h>

#include <utility> 
#include <cassert>
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>


using carbon::Optional;


#define STR_CONCAT(a, b_) a.m_##b_

void print_string(const std::string &s) { printf("str: %s\n", s.c_str());  }
void print_string(const char * s) { printf("chars: %s\n", s);  }


int main(int argc, char **argv)
{
    const char * pstr = "Hello World";
    char str[] = "Hello World";
    printf("sizeof(str): %d\n", sizeof(str)) ;
    printf("sizeof(pstr): %d\n", sizeof(pstr)) ;
    
    print_string("Hello World");

    auto opt = Optional<std::string>::empty();
    assert(!opt.isPresent());

    auto opt1 = Optional<std::string>::of("Hello");
    assert(opt1.isPresent());
    assert(opt1.get() == "Hello");

    std::string && s1 = std::move(opt1).get();
    assert(s1 == "Hello");

    return 0;
}

